package org.example.dao;



import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.example.model.Book;

import java.util.List;

@Mapper
public interface BookMapper {
    int addBook(Book book);
    int deleteBook(int id);
    int updateBook(Book book);
    Book getBookById(int id);
    List<Book> getBooks(Book book);
    //如果接口方法定义的参数大于等于2个以上，参数前面就需要加上@Param
    List<Book> getBooksByTypeAndName(@Param("btype") int btype, @Param("bname") String name);

    int updateSelectBooks(@Param("ids") List ids, @Param("price") double price);


}
